package pe.com.cineplanet.dao.mapper;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import pe.com.cineplanet.bean.Articulo;
import pe.com.cineplanet.bean.Rubro;

public class ArticuloMapper implements RowMapper{

	public Articulo mapRow(ResultSet rs, int arg1) throws SQLException {
		
		Articulo articulo = new Articulo(
				rs.getString("id_articulo"),
				rs.getString("descripArticulo"),
				rs.getDouble("precio"),
				new Rubro(rs.getString("id_rubro"), rs.getString("descripRubro"))
				);
		
		return articulo;
	}

}
